'''
class Stu(object):
     def __init__(self, name, score):
             self.name = name
             self.score = score
     def get_grage(self):
             if self.score >= 90:
                     return 'A'
             elif self.score >= 60:
                     return 'B'
             else:
                     return 'C'
					 

ss = Stu('ssf', 99)
ff = Stu('ff', 59)
dd = Stu('dd', 89)

print(ss.get_grage(), ff.get_grage(), dd.get_grage())

'''
class Stu(object):
	def __init__(self, n, g):
		self.__n = n
		self.__g = g
	
	def get_gender(self):
		
		return self.__g
		
	def set_gender(self, g):
	
		if g in ('female', 'male'):
			self.__g = g
		else:
			raise ValueError('bad gender')

bart = Stu('Bart', 'male')
print(bart.get_gender())

bart.set_gender('female')
print(bart.get_gender())

bart.set_gender('123')
